<template>
  <div class="mains">
    <div class="box-1">
        <div class="titles">
          {{$t('CONGRATULATIONS')}}
        </div>
      <div class="bottom-q">
        <p>{{dataForm.title}}</p>
        <p class="ti">
          {{$t('用户名')}} : <span>{{ userInfo.username }}</span>
        </p>
        <p class="ti">
          {{$t('答题')}} : <b>{{ dataForm.questionNum }}</b>
        </p>
        <p class="ti">
          {{$t('正确')}} : <b>{{ dataForm.questionNum }}</b>
        </p>
        <p class="ti">
          {{$t('答题时间')}} : <span>{{ parseTime(new Date()) }}</span>
        </p>

        <div class="button">
          <a v-routers="{path:'/'}" href="javascript:void (0)">
            {{$t('返回首页')}}
          </a>
        </div>
      </div>
    </div>
  </div>
</template>

<script>
import {getQuestionAct, userDetail} from "@/api/apiFox";
import {parseTime} from "../../utils";

  export default {
    data(){
      return{
        dataForm:{},
        userInfo:{}
      }
    },
    methods:{
      parseTime,
      getList(){
        getQuestionAct().then(res=>{
          console.log(res)
          this.dataForm=res
        }).catch(err=>{})
        userDetail().then(res => {
          this.userInfo = res
        }).catch(err => {})
      }
    },
    mounted() {
      this.getList()
    }
  }
</script>

<style scoped lang="scss">
.mains {
  font-size: 14px;
  background: url("@/assets/images/bgk.jpg") no-repeat;
  background-size: 100% 100%;
  width: 100%;
  min-height: 100vh;

  box-sizing: border-box;
  padding: 48px 10px 10px 10px;
  .top-header {
    width: 100%;
    position: absolute;
    top: 20px;
    left: 20px;
    pointer-events: auto;
    font-family: 'Fugaz One', sans-serif;
    font-weight: 800;
  }
  .box-1{
    width: 100%;
    min-height: 100px;
    //background: #fff;
    border-radius: 5px;
    padding: 10px;
    box-sizing: border-box;
    .titles{
      text-align: center;
      width: 100%;
      font-size: 24px;
      color: #ff0000;
      text-shadow: -1px -1px 0 #fff,
      1px -1px 0 #fff,
      -1px 1px 0 #fff,
      1px 1px 0 #fff; // 白色描边
      font-family: 'AnimeHug', sans-serif;
    }
    .bottom-q{
      width: 100%;
      margin-top: 80px;
      min-height: 100px;
      background: #27747e;
      border-radius: 10px;
      padding: 15px;
      box-sizing: border-box;
      font-size: 18px;
      color: #ff0000;
      text-shadow: -1px -1px 0 #fff,
      1px -1px 0 #fff,
      -1px 1px 0 #fff,
      1px 1px 0 #fff; // 白色描边
      font-family: 'AnimeHug', sans-serif;
      p:nth-child(1){
        margin-top: 10px;
        margin-bottom: 23px;
      }
      .ti{
        margin-top: 10px;
        font-size: 14px;
        color: rgba(255,162,35,0.97);
        b{
          font-size: 24px;
          color: #ff0000;
          text-shadow: -1px -1px 0 #fff,
          1px -1px 0 #fff,
          -1px 1px 0 #fff,
          1px 1px 0 #fff; // 白色描边
        }
        span{
          color: #cb1b0f;
        }
      }

      .button{
        width: 100%;
        margin-top: 65px;
        text-align: center;
        height: 65px;
        display: flex;
        justify-content: center;
        align-items: center;
        a{
          width: 150px;
          height: 45px;
          background: url('@/assets/images/btn.png') no-repeat;
          background-size: 100% 100%;
          display: flex;
          justify-content: center;
          align-items: center;
          color: #cb1b0f;
          font-size: 16px;
        }
      }
    }
  }
}
</style>
